package my.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class JdbcProperties {

	public static String driver;
	public static String url;
	public static String username;
	public static String password;

	static {
		Properties configuration = new Properties();
		InputStream in = null;
		try {
			in = JdbcProperties.class.getResourceAsStream("jdbc.properties");
			configuration.load(in);

			driver = configuration.getProperty("jdbc.driverClassName");
			url = configuration.getProperty("jdbc.url");

			username = configuration.getProperty("jdbc.username");
			password = configuration.getProperty("jdbc.password");
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (in != null) {
				try {
					in.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}

}
